﻿{{include 'admin/public/header.html'}}

	<body>
		<div class="navbar navbar-default" id="navbar">
			<script type="text/javascript">
				try{ace.settings.check('navbar' , 'fixed')}catch(e){}
			</script>

			{{include 'admin/public/nav_top.html'}}
		</div>

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>

				<!--左侧导航-->

				{{include 'admin/public/nav_left.html'}}

				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="#">首页</a>
							</li>
							<li class="active">控制台</li>
						</ul><!-- .breadcrumb -->

						<div class="nav-search" id="nav-search">
							<form class="form-search">
								<span class="input-icon">
									<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
									<i class="icon-search nav-search-icon"></i>
								</span>
							</form>
						</div><!-- #nav-search -->
					</div>

					<div class="page-content">

						<div class="page-header">
							<h1>
								编辑分类
							</h1>
						</div><!-- /.page-header -->



							<!--表格-->

							<form action="{{__HOST_}}/admin/articlecate/doEdit" method="post" class="form-horizontal" role="form">
								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right" for="title">分类名称:</label>

									<div class="col-sm-10">
										<input type="text" id="title"  name="title" class="col-xs-10 col-sm-5" value="{{list.title}}" />


										<input type="hidden" value="{{@list._id}}" name="id" />
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right" for="pid">上级分类：</label>

									<div class="col-sm-10">
										<select name="pid" id="pid">
											<option value="0">--顶级分类--</option>

											{{each catelist}}

													<option value="{{@$value._id}}" {{if list.pid==$value._id}} selected{{/if}}>{{$value.title}}</option>


											{{/each}}
										</select>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right" for="keywords">关键字：</label>

									<div class="col-sm-10">
										<input type="text" id="keywords"  name="keywords" class="col-xs-10 col-sm-5" value="{{list.keywords}}" />
									</div>
								</div>



								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right">状态：</label>
									<div class="col-sm-10">
										<label for="status1">已审核：</label><input type="radio" name="status" {{if list.status=="1"}} checked{{/if}}  id="status1" value="1"  />
										&nbsp;
										<label for="status2">未审核:</label><input type="radio" name="status" id="status2" {{if list.status=="0"}} checked{{/if}} value="0" />
									</div>
								</div>

								<div class="form-group" style="height:100px;">
									<label class="col-sm-2 control-label no-padding-right" for="description">描述：</label>
									<div class="col-sm-10">
										<textarea  style="height:100px;" class="col-xs-10 col-sm-5"  name="description" id="description" cols="10" rows="10">{{list.description}}</textarea>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right" for="description"></label>

									<div class="col-sm-10">
										<button type="submit" class="btn btn-primary">提交</button>
									</div>
								</div>
							</form>
						</div>

					</div>
				</div><!-- /.main-content -->
			
			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->



	{{include 'admin/public/footer.html'}}

		<script type="text/javascript">
			jQuery(function($) {
								
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			
			
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			})
		</script>
	
</body>
</html>

